package chapter7;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

public class FileTest {

	public static void main(String[] args) throws IOException{
		
		FileInputStream fis = new FileInputStream("e:/123.txt");
	
		InputStreamReader isr = new InputStreamReader(fis,"UTF-8");
	
		BufferedReader br = new BufferedReader(isr);
		
		StringBuilder sb = new StringBuilder();
		
		int data = -1;
		
		while((data=br.read())!=-1){
			
			sb.append((char)data);
		}
		System.out.println(sb);
		
		fis.close();
	}
}
